package com.longteng.diamond.dubboservice.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Lists;
import com.longteng.diamond.dubboservice.PayService;
import com.longteng.diamond.po.RequestResult;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * Created by Administrator
 * DATE : 2018/8/26
 * TIME : 17:04
 * PROJECT : java-lesson
 * PACKAGE : com.longteng.lesson
 *
 * @author <a href="mailto:taki@qq.com">Administrator</a>
 */
@Slf4j
@Service(version = "1.0",group = "longteng")
public class PayServiceImpl implements PayService {
    @Override
    public String payStr(String str) {
        log.info(str);
        return "支付成功了";
    }

    @Override
    public RequestResult pay(RequestResult requestResult) {

        System.out.println("接收到的参数:"+requestResult.getMsg());

        RequestResult requestResult1=new RequestResult();
        requestResult1.setSuccess(true);
        requestResult1.setMsg("支付成功");
        requestResult1.setCode(200);
        List list= Lists.newArrayList();
        list.add("支付");
        requestResult1.setObj(list);
        return requestResult1;
    }

    @Override
    public List<RequestResult> payList(List<RequestResult> requestResults) {
        System.out.printf(JSON.toJSONString(requestResults));
        return requestResults;
    }
}
